textiter: fix bug in case insensitive backward search
authorSébastien Wilmet <swilmet@gnome.org>
Thu, 26 Nov 2015 12:31:19 +0000 (13:31 +0100)
committerSébastien Wilmet <swilmet@gnome.org>
Mon, 30 Nov 2015 18:46:16 +0000 (19:46 +0100)
commit1a8f3e2462829f8a186590a6ad6b7642309baa5b
tree7fb64ae5d767b38adad0c4cda2e03c819e29d4e2
parent0a35886b0a39a57b819d1f51adb357c13bda5bf3
textiter: fix bug in case insensitive backward search

'win.lines' contains the same content as the GtkTextBuffer, so to find
@match_start, forward_chars_with_skipping() is called with
skip_decomp=FALSE (the last parameter). So far so good.

On the other hand, the content 'lines' (the needle split in lines) is
casefolded and normalized for a case insensitive search. So,
forward_chars_with_skipping(..., skip_decomp=TRUE) must be called only
for the portion of text containing the needle.

Since 'start_tmp' contains the location at the start of the match, we
can simply begin at that location to find the end of the match.

Unit tests are added.

https://bugzilla.gnome.org/show_bug.cgi?id=758698
gtk/gtktextiter.c
testsuite/gtk/textiter.c